// / <reference types='./typing' />

import '../asset/style/style.scss';

import scrollreveal from 'scrollreveal';
import Header from './header';
import Banner from './banner';
import Module from './module';

class Index {
  [key: string]: any;
  private banner: Banner;
  constructor() {
    this.scrollreveal = new scrollreveal();
    this.header = new Header();
    this.banner = new Banner('.index-banner', {
      key: 'HomePlay1'
    });
    this.module1 = new Module('.module-page1', {
      categoryId: '1',
      icon: 'web-icon1',
      name: '什么是侧弯',
      url: 'page1.html',
      type: 'grid',
      page: 1,
      pageSize: 3,
      column: 3,
      callback: () => {
        // this.scrollreveal.reveal('.module-grid-item', { duration: 500, distance: '50px', rotate: { y: 45, x: 45, z: 45 } }, 50);
        this.scrollreveal.reveal('.module-grid-item', { duration: 800, distance: '50px', scale: 1 }, 50);
      }
    });
    this.module2 = new Module('.module-page2', {
      categoryId: '2',
      icon: 'web-icon2',
      name: '体操矫形',
      url: 'page2.html',
      type: 'row',
      page: 1,
      pageSize: 3,
      callback: () => {
        this.scrollreveal.reveal('.module-row-item', { duration: 800, distance: '50px', scale: 1 }, 50);
      }
    });
  }
}


$(() => {
  new Index();
});